The present invention generally relates to electronic apparatuses and methods of controlling electronic apparatuses, and more particularly to an electronic apparatus such as a bar code reader and to a method of controlling such an electronic apparatus which has a function of making a state transition depending on external light.
A laser type bar code reader reads a bar code by irradiating a laser scanning light on the bar code and detecting reflected light from the bar code. In the bar code reader, the laser light emitted from a laser diode is irradiated on a scanning means such as a polygonal mirror which is rotated by a motor, and the reflected laser light from the polygonal mirror scans in a plurality of directions. The reflected laser light, that is, the laser scanning light, is emitted to the outside via a read window.
The laser scanning light emitted to the outside via the read window is irradiated on a bar code which is provided on an item or the like. The bar code includes bar portions and space portions which are arranged with a predetermined arrangement that is prescribed by a standard such as the Universal Product Code (UPC), European Article Code (EAC) and Japan Article Numbering (JAN).
The laser scanning light irradiated on the bar code is reflected and is returned via the read window towards a photodiode which converts the returned light into an electrical signal. This electrical signal dependent on the read bar code is decoded and processed in a central processing unit (CPU) and is supplied to a point-of-sales (POS) system or the like.
When reading the bar code by the bar code reader, it is necessary to emit the laser light and rotate the polygonal mirror so as to obtain the laser scanning light. The serviceable life of the laser diode will be shortened if the laser light is emitted even when the bar code is not read. For this reason, the bar code reader is provided with a function of automatically stopping or reducing the light emission quantity of the laser light when not reading the bar code, that is, when not using the laser light.
According to the function of automatically stopping or reducing the light emission quantity of the laser light, the laser light and the motor which rotates the polygonal mirror are controlled by detecting a change in external light and a time for which no bar code label is read.
A description will be given of an example of the control operation of the conventional bar code reader, by referring to a flow chart shown in FIG. 1.
When a power supply of the bar code reader is turned ON, a step S3-1 shown in FIG. 1 rotates a motor which drives a scan means for making a laser light scan. A step S3-2 supplies a current to a laser diode so as to emit the laser light with a normal intensity. When a bar code is read in this state, a read bar code is decoded and the decoded data is transmitted to a POS or the like by steps S3-3 through S3-6.
The step S3-3 decides whether or not the bar code label is detected, and the step S3-4 decodes the read bar code if the decision result in the step S3-3 is YES. The step S3-5 decides whether or not the decoding of the read bar code is completed, and the process returns to the step S3-3 if the decision result in the step S3-5 is NO. On the other hand, if the decision result in the step S3-5 is YES, the step S3-6 transmits the decoded data to the POS or the like, and the process returns to the step S3-3.
If no bar code label is detected and the decision result in the step S3-3 is NO, a step S3-7 decides whether or not the state in which no bar code label is detected lasts for 10 seconds, and the process returns to the step S3-3 if the decision result in the step S3-7 is NO. On the other hand, if the decision result in the step S3-7 is YES, it is judged that the bar code reader is not in frequent use, and a step S3-8 sets the laser light output to 50% the normal output.
A step S3-9 decides whether or not the bar code label is read using the laser light output which is 50% the normal output, and the process returns to the step S3-2 if the decision result in the step S3-9 is YES so as to set the laser light output to 100% the normal output, that is, to emit the laser light with the normal intensity. On the other hand, if the decision result in the step S3-9 is NO, a step S3-10 decides whether or not the state in which no bar code label is detected lasts for 9 minutes and 50 seconds, and the process returns to the step S3-8 if the decision result in the step S3-10 is NO. If the decision result in the step S3-10 is YES, it is judged that the bar code reader is in a halt state, and a step S3-11 turns the laser diode OFF.
After the step S3-11, a step S3-12 decides whether or not the light quantity of external light has decreased by 10%, and the process returns to the step S3-2 if the decision result in the step S3-12 is YES. The external light is blocked and the detected light quantity decreases when reading the bar code. Hence, if the decision result in the step S3-12 is YES, it is judged that the bar code reader is in use and the bar code closely confronts the read window.
On the other hand, if the decision result in the step S3-12 is NO, a step S3-13 decides whether or not the state in which no decrease of the light quantity of the external light by 10% or more lasts for 20 minutes. The process returns to the step S3-12 if the decision result in the step S3-12 is NO. On the other hand, if the decision result in the step S3-13 is YES, it is judged that the bar code reader is in a complete halt, and a step S3-14 stops the motor which drives the polygonal mirror.
Then, a step S3-15 decides whether or not the light quantity of the external light has decreased by 10% after the motor is stopped. The step S3-15 is carried out until the decision result therein becomes YES, and the process returns to the step S3-1 when the decision result in the step S3-15 becomes YES. The laser diode is turned OFF and the motor is maintained in the stopped state while the decrease of the light quantity of the external light in the step S3-15 is less than 10%.
According to the conventional bar code reader, it is judged that an operation is to be made when the light quantity of the external light detected by a sensor decreases by 10% or more. Otherwise, that is, when the decrease of the light quantity of the external light is less than 10%, the laser diode is controlled to emit the laser light at 50% of the normal intensity or to turn OFF and the motor which drives the polygonal mirror is controlled to stop.
However, the conventional bar code reader judges that the bar code is to be read when the light quantity of the external light decreases by 10% or more, regardless of the environment in which the bar code reader is set up. In other words, the external light is detected with a constant sensitivity regardless of the setup environment of the bar code reader, and the judgement which determines whether or not the bar code is to be read is made based on this detection made with the constant sensitivity.
For this reason, if the external light detection sensitivity is set too high, the motor and the laser diode of the bar code reader erroneously resume the operating state in which the bar code is readable even in response to a shadow of a person, when the bar code reader is set up at a location where a large number of people pass and the surrounding light quantity easily changes. On the other hand, if the external light detection sensitivity is set too low, the bar code reader may not operate even when an item closely confronts the read window so as to read the bar code. More particularly, the laser diode may not emit light and the motor which drives the polygonal mirror may not rotate even when the item closely confronts the read window, thereby making it impossible to read the bar code. Therefore, the conventional bar code reader had the above described problems which are caused by the inappropriately set external light detection sensitivity.